<<<<<<< HEAD
<template>
	<div class="icon-box">
		<ul>
			<swiper :options="swiperOption">
				<swiper-slide v-for="(page,index) of pages" :key="index">
					<li v-for="item of page" :key="item.id">
						<div class="icon-img">
							<img :src="item.imgUrl" :alt="item.desc" />
						</div>
						<p>{{item.desc}}</p>
					</li>
				</swiper-slide>		
			</swiper>
		</ul>
	</div>
</template>

<script>
	export default{
		name:'IndexNav',
		props:{
			iconList:Array
		},
		data () {
			return {
				swiperOption:{
					autoplay:false
				},
			}	
		},
		computed:{
			pages () {  
				const pages = []
				if(this.iconList){
					this.iconList.forEach((item, index) => {
						const page = Math.floor(index / 8)
						if(!pages[page]){
							pages[page]=[]
						}
						pages[page].push(item)
					})
					
				}
				return pages
			}
			
		}
	}
</script>

<style scoped>
	.icon-box{
		height: 0px;
		padding-bottom: 50%;
		overflow: hidden;
		margin: .3rem auto;
	}
	.icon-box li{
		float: left;
		width: 25%;
		padding-bottom: 25%;
		height: 0;
		position: relative;
	}
	.icon-box li .icon-img{
		width: 80%;
		margin: 0px auto;
	}
	.icon-box li .icon-img img{
		width: 100%;
		display: block;
		margin: 0px auto;
	}
	.icon-box li p{
		line-height: .44rem;
		color: #333;
		position: absolute;
		bottom: 0;
		text-align: center;
		width: 100%;
	}
</style>
=======
<template>
	<div class="icon-box">
		<ul>
			<swiper :options="swiperOption">
				<swiper-slide v-for="(page,index) of pages" :key="index">
					<li v-for="item of page" :key="item.id">
						<div class="icon-img">
							<img :src="item.imgUrl" :alt="item.desc" />
						</div>
						<p>{{item.desc}}</p>
					</li>
				</swiper-slide>		
			</swiper>
		</ul>
	</div>
</template>

<script>
	export default{
		name:'IndexNav',
		props:{
			iconList:Array
		},
		data () {
			return {
				swiperOption:{
					autoplay:false
				},
			}	
		},
		computed:{
			pages () {  
				const pages = []
				if(this.iconList){
					this.iconList.forEach((item, index) => {
						const page = Math.floor(index / 8)
						if(!pages[page]){
							pages[page]=[]
						}
						pages[page].push(item)
					})
					
				}
				return pages
			}
			
		}
	}
</script>

<style scoped>
	.icon-box{
		height: 0px;
		padding-bottom: 50%;
		overflow: hidden;
		margin: .3rem auto;
	}
	.icon-box li{
		float: left;
		width: 25%;
		padding-bottom: 25%;
		height: 0;
		position: relative;
	}
	.icon-box li .icon-img{
		width: 80%;
		margin: 0px auto;
	}
	.icon-box li .icon-img img{
		width: 100%;
		display: block;
		margin: 0px auto;
	}
	.icon-box li p{
		line-height: .44rem;
		color: #333;
		position: absolute;
		bottom: 0;
		text-align: center;
		width: 100%;
	}
</style>
>>>>>>> 4c3bd4f5377e02833035f132e73ff4e381ba19e4
